<meta charset="UTF-8">
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
 session_start();
 if(@$_SESSION['username']=="") {
   echo "<script>alert('您还没有登录,请先登录!');history.back();</script>";
   exit;
  }
  
  include ("top.php");
?>
<script language="javascript">
		     function check_input2(form2)
			  {
			    if(form2.age.value=="")
				{
				  alert("年龄不能为空!");
				  form2.age.select();
				  return(false);
				}
				if(form2.tel.value=="")
				{
				  alert("联系方式不能为空!");
				  form2.tel.select();
				  return(false);
				}
				if(form2.reserved_info.value=="")
				{
				  alert("预留信息不能为空!");
				  form2.reserved_info.select();
				  return(false);
				}
			   
				return(true);
			  }
</script>
<table width="766" height="438" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="209" height="438" valign="top" bgcolor="#F5F5F5"><?php include("left.php");?></td>
    <td width="537" align="center" valign="top" bgcolor="#FFFFFF"><table width="500" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td></td>
      </tr>
    </table>
      <table width="550" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><div align="center"><a href="usercenter.php">修改个人信息</a>&nbsp;<span style="color: #0000FF"></span><a href="changememberspwd.php">修改密码</a>&nbsp;<span style="color: #0000FF"></span><a href="showorder.php">订单管理</a>&nbsp;<span style="color: #0000FF"></span><a href="logout.php">注销离开&nbsp;</a></div></td>
        </tr>
      </table>
      <table width="500" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
      </table>
      <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="20" bgcolor="#B0E0E6"><div align="center"><?php echo $_SESSION['username'];?>的所有信息</div></td>
        </tr>
        <tr>
          <td height="160" bgcolor="#B0E0E6"><table width="500" height="160" border="0" align="center" cellpadding="0" cellspacing="1">
              <form name="form2" method="post" action="changemembers.php" onSubmit="return check_input2(this)">
                <?php
                   $conn = prepare();
                   $sql = exectue_sql_statement($conn, "select * from Members where members_name='".$_SESSION['username']."'");
		   $info=sqlsrv_fetch_array($sql);
		  
		  ?>
                <tr>
                  <td width="100" height="20" bgcolor="#FFFFFF"><div align="center">昵称：</div></td>
                  <td width="397" bgcolor="#FFFFFF"><div align="left"><?php echo $_SESSION['username'];?></div></td>
                </tr>
                <tr>
                  <td height="20" bgcolor="#FFFFFF"><div align="center">性别：</div></td>
                  <td height="20" bgcolor="#FFFFFF"><div align="left">
                        <select name="sex">
                            <option name="1" value="1" selected="selected">男</option>
                            <option name="2" value="2">女</option>
                        </select>
                  </div></td>
                </tr>
                <tr>
                  <td height="20" bgcolor="#FFFFFF"><div align="center">年龄：</div></td>
                  <td height="20" bgcolor="#FFFFFF"><div align="left">
                          <input type="number" name="age" size="20" min="1" max="100" value="<?php echo $info['members_age'];?>">
                  </div></td>
                </tr>
                <tr>
                  <td height="20" bgcolor="#FFFFFF"><div align="center">联系方式：</div></td>
                  <td height="20" bgcolor="#FFFFFF"><div align="left">
                          <input type="text" name="tel" size="20" maxlength="11" value="<?php echo $info['members_tel'];?>">
                  </div></td>
                </tr>
                <tr>
                  <td height="20" bgcolor="#FFFFFF"><div align="center">预留信息：</div></td>
                  <td height="20" bgcolor="#FFFFFF"><div align="left">
                          <input type="text" name="reserved_info" size="20" maxlength="20" value="<?php echo $info['reserved_information'];?>">
                  </div></td>
                </tr>
                <tr>
                  <td height="20" colspan="2" bgcolor="#FFFFFF"><div align="center">
                      <input name="submit2" type="submit" class="buttoncss" value="更改">
&nbsp;&nbsp;
                <input name="reset" type="reset" class="buttoncss" value="取消更改">
                  </div></td>
                </tr>
              </form>
          </table></td>
        </tr>
      </table>
      </td>
  </tr>
</table>
<?php
 include("bottom.php");
?>
